package com.yc.bean;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 心理测评实体类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("psychologicalTests")
public class PsychologicalTest {
    
    @TableId(value = "testId", type = IdType.AUTO)
    private Long testId;
    
    @TableField("title")
    private String title;
    
    @TableField("description")
    private String description;
    
    @TableField("icon")
    private String icon;
    
    @TableField("categoryId")
    private Long categoryId;
    
    @TableField("duration")
    private Integer duration;
    
    @TableField("questionCount")
    private Integer questionCount;
    
    @TableField("type")
    private String type;
    
    @TableField("scoringType")
    private String scoringType;
    
    @TableField("tags")
    private String tags; // JSON字符串存储
    
    @TableField("instructions")
    private String instructions;
    
    @TableField("status")
    private Integer status; //状态 1-启用 0-禁用
    
    @TableField("sortOrder")
    private Integer sortOrder;
    
    @TableField(value = "createTime", fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    
    @TableField(value = "updateTime", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
    
    // 非数据库字段：关联信息
    @TableField(exist = false)
    private List<TestQuestion> questions;
    
    @TableField(exist = false)
    private String categoryName;
    
    @TableField(exist = false)
    private Integer userStatus; // 用户测评状态：0-未开始, 1-进行中, 2-已完成
    
    @TableField(exist = false)
    private Long recordId; // 用户测评记录ID
    
    @TableField(exist = false)
    private Integer progress; // 测评进度
    
    @TableField(exist = false)
    private LocalDateTime lastTestTime; // 最后测评时间
    
    @TableField(exist = false)
    private List<UserTestAnswer> userAnswers; // 用户答题记录
} 